#ifndef LIB_BINARY_TREE_H_
#define LIB_BINARY_TREE_H_

#include <vector>
#include <deque>

struct BinaryTreeNode {
    int value;
    BinaryTreeNode* left;
    BinaryTreeNode* right;
};

struct BinaryTreeWithParentNode {
    int value;
    BinaryTreeWithParentNode* parent;
    BinaryTreeWithParentNode* left;
    BinaryTreeWithParentNode* right;
};

BinaryTreeNode* CreateBinaryTreeNode(int value);
BinaryTreeWithParentNode* CreateBinaryTreeWithParentNode(int value);

void ConnectNode(BinaryTreeNode* parent, BinaryTreeNode* left, BinaryTreeNode* right);
void ConnectNode(BinaryTreeWithParentNode* parent, BinaryTreeWithParentNode* left, BinaryTreeWithParentNode* right);

BinaryTreeNode* CreateBinaryTree(std::vector<int> nodes_vec);
BinaryTreeWithParentNode* CreateBinaryTreeWithParentNode(std::vector<int> nodes_vec);

void PrintBinaryTreeNode(BinaryTreeNode* node);
void PrintBinaryTreeNode(BinaryTreeWithParentNode* node);

void PrintBinaryTree(BinaryTreeNode* root);
void PrintBinaryTree(BinaryTreeWithParentNode* root);

void DeleteBinaryTree(BinaryTreeNode* root);
void DeleteBinaryTree(BinaryTreeWithParentNode* root);

#endif
